﻿// MIT License
// 开源地址：https://gitee.com/co1024/AbcMvc
// Copyright (c) 2021-2023 1024
// Abc.Mvc=Furion+EF+SqlSugar+Pear layui admin.

namespace Abc.Core.SeedData;

/// <summary>
///     系统配置
/// </summary>
public class SysDataConfigSeedData : IEntitySeedData<SysDataConfig>
{
    public IEnumerable<SysDataConfig> HasData(DbContext dbContext, Type dbContextLocator)
    {
        return GetData();
    }

    private List<SysDataConfig> GetData()
    {
        var data = new List<SysDataConfig>
        {
            new()
            {
                Id = 1,
                Key = "SysSetting",
                PKey = "",
                Name = "系统设置",
                Value = ""
            },
            new()
            {
                Id = 2,
                Key = "CodeGenerateConfig",
                GroupName = "CodeGenerateConfig",
                PKey = "",
                Name = "代码生成配置",
                Value = ""
            },
            new()
            {
                Id = 3,
                Key = "DbDifferenceTableConfig",
                GroupName = "DbDifferenceTableConfig",
                PKey = "",
                Name = "数据库差异对比设置",
                Value = ""
            },
            //其它设置

            new()
            {
                Id = 1001,
                PKey = "SysSetting",
                Key = "WebName",
                Name = "网站名称",
                Value = "ABC Admin"
            },
            new()
            {
                Id = 1002,
                PKey = "SysSetting",
                Key = "WebDomain",
                Name = "网站域名",
                Value = ""
            },
            new()
            {
                Id = 1003,
                PKey = "SysSetting",
                Key = "WebLogo",
                Name = "网站logo",
                Value = ""
            },
            new()
            {
                Id = 1004,
                PKey = "SysSetting",
                Key = "DatabaseBackupPath",
                Name = "数据库备份路径",
                Value = "dbblack"
            },
            new()
            {
                Id = 1005,
                PKey = "SysSetting",
                Key = "DatabaseBackupSwitch",
                Name = "数据库备份开关",
                Value = "false"
            },
            new()
            {
                Id = 1006,
                PKey = "SysSetting",
                Key = "DatabaseBackupTime",
                Name = "数据库备份时间",
                Value = "02:00"
            },
            new()
            {
                Id = 1007,
                PKey = "SysSetting",
                Key = "WebBeianNo",
                Name = "网站备案号",
                Value = ""
            },
            new()
            {
                Id = 1008,
                PKey = "SysSetting",
                Key = "ContactUs",
                Name = "联系我们",
                Value = ""
            },
            new()
            {
                Id = 1009,
                PKey = "SysSetting",
                Key = "AboutUs",
                Name = "关于我们",
                Value = ""
            },
            new()
            {
                Id = 1010,
                PKey = "SysSetting",
                Key = "HelpCenter",
                Name = "帮助中心",
                Value = ""
            },
            new()
            {
                Id = 1011,
                PKey = "SysSetting",
                Key = "MetaKeywords",
                Name = "META关键词",
                Value = "公司,ABC"
            },
            new()
            {
                Id = 1012,
                PKey = "SysSetting",
                Key = "MetaDescribe",
                Name = "META描述",
                Value = "ABC Admin"
            },
            new()
            {
                Id = 1013,
                PKey = "SysSetting",
                Key = "CopyrightInformation",
                Name = "版权信息",
                Value = "©2012-2022 ABC Admin 版权所有"
            },
            new()
            {
                Id = 1014,
                PKey = "SysSetting",
                Key = "IsOpenIpBlack",
                Name = "是否开启IP黑名单",
                Value = "true"
            }
        };

        foreach (var item in data) item.IsEnable = true;

        return data;
    }
}